import request from '@/utils/request.js'

export function listCourse(queryparams) {
  return request({
    url: '/course/history',
    method: 'GET',
    params: queryparams
  })
}

/**
 * 获取课程的课件
 * @param id
 * @returns {*}
 */
export function listcourseware(id) {
  return request({
    url: `/course/courseware/${id}`,
    method: 'GET'
  })
}

/**
 * 获取用户最近学习课程
 * @param userId
 * @param queryParams
 */
export function listRecentCourse(userId, queryParams) {
  return request({
    url: `/course/history/recent/${userId}`,
    method: 'GET',
    params: {
      pageNum: queryParams.pageNum,
      pageSize: queryParams.pageSize
    }
  })
}